package com.tech.connect.api;


import com.ksy.common.utils.CommonApiUtils;
import com.tech.connect.model.ItemFuWuZhan;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;

/**
 * Created by Ksy
 */

public class FuWuZhanHttp extends CommonApiUtils {
    public static Map<String, Object> getMap() {
        return new HashMap<>();
    }

    public interface ConnectApiServer {
        //创建
        @POST("v1/service/station/create")
        Observable<BaseEntity<String>> create(@Body Map<String, Object> map);

        //详情
        @POST("v1/service/station/info")
        Observable<BaseEntity<Map<String, String>>> detail(@Body Map<String, Object> map);

        //我加入的
        @POST("v1/service/station/join/list")
        Observable<BaseEntity<List<ItemFuWuZhan>>> joinList(@Body Map<String, Object> map);

        //我的
        @POST("/v1/service/station/my/list")
        Observable<BaseEntity<List<ItemFuWuZhan>>> mineList(@Body Map<String, Object> map);

        //加入
        @POST("v1/service/station/sign")
        Observable<BaseEntity<Map<String, String>>> join(@Body Map<String, Object> map);

        //退出
        @POST("v1/service/station/sign-out")
        Observable<BaseEntity<Map<String, String>>> exit(@Body Map<String, Object> map);


    }

    public static Observable<BaseEntity< String>> create(Map<String, Object> map, final BaseEntityOb< String> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).create(map));
    }

    public static Observable<BaseEntity<Map<String, String>>> detail(Map<String, Object> map, final BaseEntityOb<Map<String, String>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).detail(map));
    }

    public static Observable<BaseEntity<List<ItemFuWuZhan>>> joinList(Map<String, Object> map, final BaseEntityOb<List<ItemFuWuZhan>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).joinList(map));
    }

    public static Observable<BaseEntity<List<ItemFuWuZhan>>> mineList(Map<String, Object> map, final BaseEntityOb<List<ItemFuWuZhan>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).mineList(map));
    }

    public static Observable<BaseEntity<Map<String, String>>> join(Map<String, Object> map, final BaseEntityOb<Map<String, String>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).join(map));
    }

    public static Observable<BaseEntity<Map<String, String>>> exit(Map<String, Object> map, final BaseEntityOb<Map<String, String>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).exit(map));
    }


}
